#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    button = new QPushButton(this);
    button->setText("widget.cpp");
    button->move(150,150);

    connect(button, &QPushButton::clicked,this, &Widget::change);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::change()
{
    if(button->text() == QString("widget.cpp"))
    {
        button->setText("widget.h");
    }
    else
    {
        button->setText("widget.cpp");
    }
}
